> Ii got that, syntax "if(a=='\n')" make its true only if we press ctrl+enter. If we simply press en

Ii got that, syntax "if(a=='\n')" make its true only if we press ctrl+enter. If we simply press en

Posted at: 2014-12-18 
Is this rule of C or there's something error in my syntax?

You are running with an OLD DOS program, probably. Look for a match with '\r' for ENTER, in this case. See if that works for you. (Or just compare with decimal 13.)

Your question is entirely context dependent. Consequentially, absolutely no context is provided in the question.

The expression

(a == '\n') evaluates to true if a holds the value '\n'.

You can examine a to discover what it contains since it doesn't seem to contain what you expect.

Is this rule of C or there's something error in my syntax?